fix(ops): chat messages 500 when artifact write hits circuit breaker - #240
Merged
Conversation
…breaker Swallow failure-event write errors and make react/deep post-answer store writes best-effort so /ops/chat/messages still returns the answer. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/py/ops/chat/messagesReAct/deep 收尾写ops_run_artifacts时若撞上 Supabase 熔断,写artifact.write_failed事件也会再失败并上抛,导致前端 BFF(/api/ops/chat/messages)透传 500。save_artifact_with_failure_event改为失败事件也 best-effort;熔断 / 缺表(PGRST205)不重试;react/deep 在答案落地后的 artifact/metrics 写库整体吞掉,仍返回 answer。Test plan
pytest tests/ops/test_artifacts.py tests/ops_desk/test_orchestrator_p1.py -qPOST /api/py/ops/chat/messages(hello/ 闲聊)返回 200(clarify/react),不再 Internal Server Errorhttps://ai-ink-brain.vercel.app/api/ops/chat/messagesMade with Cursor
CI 状态(自动 · pr-post-ci)
Required 全绿:是
变更范围(自动统计)
文件数:6
api/docs/tests/⚠ automerge 路径闸:含
api/、tests/、.github/workflows/等 — 勿打automerge或须人审 merge。命中路径
api/ops/orchestrator/core.pyapi/ops/react_loop.pyapi/ops/store/artifacts.pyapi/ops/store/runs.pytests/ops/test_artifacts.py